package factory;

import dal.Configuracion;
import dao.ColumnaDao;
import dao.TablaDao;

/**
 *
 * @author Jose Carlos Gutierrez
 */
public abstract class FactoryDao {

    protected static FactoryDao instancia;

    public static FactoryDao getFactoryInstance() {
        if (instancia == null) {
            Configuracion config = Configuracion.getConfiguracion();
            if (config.getDbEngine().equals("MySQL")) {
                instancia = FactoryDaoMySQL.getFactoryInstance();
            }
            if (config.getDbEngine().equals("PostgreSQL")) {
                instancia = FactoryDaoPostgreSQL.getFactoryInstance();
            }
        }
        return instancia;
    }

    public abstract TablaDao getNewTablaDao();

    public abstract ColumnaDao getNewColumnaDao();
}
